aspect ratio calculated in wrong place

and a variable name typo