Some small API changes and fixes