Improve layout of main window.
Don't crash when using preferences window in replicant mode.