fix bin calculation in SAM parser