Fixed compilation errors and faulty tests won't run