Fixed use of unification query