Fixed bad variable name preventing having clauses from working.