Fixed failing tests and warnings.