Fixed single line selection (zero-based index issue)