better handling for attribute queries
Merge pull request #2041 from ether/fix-get-attr

better handling for attribute queries