Minor changes to engine logic