Fixed resizing bugs