Update unittest and fixed a bug.