Fixed window resizing bugs