Applying pull request #522 to fix frame resizing