Added better error handling

Error handling for non-existent folders has been improved and tested on
windows/centos