Possible off-by-one bug fix in SAM parser