Minor fixes, unit test