fix bug in tosite where somehow the reference genome was incorrectly determined in weird cases
add some asserts