Fix errors with start_directory containing spaces

The way you are passing arguments to the shell commands makes escaping of arguments unnecessary and doing so anyway breaks things. Also, the start_directory testcase was pretty broken and did not test if the correct directory was used.