Fixed coding style and test cases.