fix nub bug and test.