API simplification and bugfixes.
