Fix AttributeIterator for non-const case
Add some more testcases to the testsuite.