Fix up some compile errors and warnings.