Fixed compile error since the branch uses a more recent version of query factory