[kmseqfile] fix bugs found by testing