Fixed bug preventing program from running with a specified dir

#3