Fix width/height determination.