Ensure spawn is called with a valid path to prevent ENOTDIR error

Fixes #25