Fix some visibility and compilation errors.