fixes to aspect ratio correction code