Changed file IO code so application can run on other computers.
Added additional error handling.
For some reason this stuff didn't get staged...