Fixing first bunch of compilation errors