Fixup cleanup code