more code cleaning

changed bad calls on query.start_min and query.start_max