Fixed method chaining in query builder