After further comparison it was definitely the query_factory file.