Fixed code style
Added some unit test