Fixed incorrect indexing and added message in docs