fix index, small improvements