Fixed a few bugs preventing the program from running on linux