fix Assert import warning, fix bug in sequence direction logic