a few bug fixes, and a bunch of convenience API methods