Fixing error introduced by last patch where bindings were lost

Like mentioned in issue #53 the new count function loses bindings causing a sql error. this patch fixes that.
Merge pull request #55 from MarkVaughn/patch-2

Fixing error introduced by last patch where bindings were lost