Fix bug in views query alter