Fixed test for before-select Query Event.
Bug fix, unset select statement on count if there were none.
Doc changes.