bug fix resulting in double counting of columns when collecting them from WHERE clause