fix some minor bugs after testing