Fixed test errors and warnings.