Add incremental removal of tracked modules and fix some bugs