Fixed compilation errors and broken test.