Adapted the library so all tests pass.