Fix build and warnings.