change path for tmp file; catch error in popen and provide error message for osx users; provide env scope for popen; #1