Server: copy object number before use as hash key

This is to prevent the JSON encoder from seeing it as a string.