Fixed bug where column as name would be used in where condition