Define __index__ (closes #1557)