Fixed an auto-resize bug.