fix various compile errors