fixed bug with spaces in path names

cleaned up debug logic
cleaned up last argument logic