update test + fix some minor bugs