ensureId initializes objects when needed. fixes #1