Fixing up attribute indexing and making tests pass for now