Added ticket search criteria and results. Removed a load of debugging messages. Other minor fixes.