Fix invalid cleanup
Merge pull request #1270 from psav/fix_pr_cleanup

Fix invalid cleanup