Bug in the indexFromPosition method.