Fix headers, compilation errors