Fixed issue #171 for `hydrateByReference()`

See issue #171, last comment. Added failing test.