Bug 1040113: Handling edge cases in cleaning up downloaded cart map

Handling edge cases in cleaning up downloaded cart map
Also, fixing a couple of minor issues