Fix a nasty resize bug