* Added some missing parts of my original "remove-main-window-dependency" patch