Lotsa fixes, some window handling