Fix #318 by boxing ints to avoid auto-coercion to Long.

Here comes the boom for #318.