Fixed some bugs related to window sizing and handling nil files.