Checking for existence of element in map before deleting.
Fixing resource name.