Make sure that the val is an int so we don't affect performance on other queries with COUNT in them.