Fixed a copy-n-paste errors
Merge pull request #93 from olegabr/feature-QQHaving

Fixed copy-paste errors. Uses proper array index.