Fixed a bug that messed up rewritten IDs by