Minor changes to counting of result sets.

And a lot of trailing whitespace changes.