Updated unit test and fixed compilation errors