Use proper return type for attribute index.
Use proper return type for attribute index.
Improve the debug output a bit.