Bug 4012: Fix NPEs due to insertion/removal of negative mappings