Update unit tests and fix few problems.