Typed API fixes and more tests.