fix some logical issues
add some test cases for each import function