Fixed query builder on TrinityCore patch (closes #5)