Rework to support new MaintainNode behavior

Fixed the testcases to do proper cleanup