1.0beta.6: fix SAM & BAM flags for first and last segment