Exposed some more API for use by tests.