Use id_for to get ID for object.

Fixes issue #36.