Merge pull request #973 from am11/master

Compiler: Rectify maps before deleting