Fixed some linux compile errors and removed compile warnings.