Simplified API and bugfixes