Fixed issue with objects that extend HashMap or implement Map