Suggested fix to broken attr behaviour

Fixed tests
Merge pull request #671 from RpprRoger/fix-map-attr

Suggested fix to broken attr behaviour