fixes issue #11 by prioritizing #attributes over #to_hash