BUG: Detection of arbitrary object fails on win64.

On Windows 64 bit the id of an object is a long and this confused the
recording logic causing recording to fail on Windows 64 bit machines.