Issue #275: Prevents multiple cleanup calls