Fix some resizing bugs