Fixed a bug with WHERE clause in query builder