Some fixes to window placement