Minor bugfixes and more straightforward API