Fixed window resizing problems