Extended solution for Attributes method [] can raise NoMethodError

Original PR was #157