Fixed bug: pymol was hanging sometimes when running the script through stdin piping. Now using the -d mode it's more stable.