Fix file choosers and other bugs

Set file choosers default locations to be the folder where the program
was run from.
Fixed some other exceptions that were being thrown.