Fixed several compiler errors/warnings.