Fix not working issue when the path contains space

This should fix the issue #23. I have only tested it on OS X. I should work on Linux as well.