Cleanups, fixes, a little API change.