Fixes #1854.
This fixes handling of messy cases involving repeatedly setting and removing the same init bit.