Ensure that the returned index is positive