Fixes compilation errors and test failures after merge