Fix for long predicate comparisons with large numbers

Fixes an issue where we were downcasting to int when constructing our query.

@tgoyne