Some improvements
Restrict arguments that can be passed on to Popen