improve unit test for master ft; add more comments; fix minor bugs