fix several compile errors