Fix minor bug and update test