Minor engine fixes

Minor engine fixes