Fixed some compile errors/warnings.