fixed string indexing (+tests)