Update ID handling.
Merge branch `rewrite` into `master`.