Allow integer-based reference values in batch, including zero.

Includes regression tests for both cases, 100% coverage.

We encountered this error when our returned id was an integer, and batch requests would fail when referencing that id. This allows for integer references and also fixes a case where a zero reference would fail this as well.