Correct resize bug