Fixed major bug in NaiveEngine