Finish commenting and code cleanup. Fix some bugs related to the error checking within the file dialog methods.