fixes to engine