Fixes resize bug that exists on py3.4

Fix py 3.4 resize bug.