Fixed bug in all rewire_* operations (failed when rewring remvoed all
entries)