Fix failing tests and make corrections.