Now uses 'getcwd()' to get working dir

Hopefully it'll compile on OSX now? I don't know.