Perform some changes to the API and fix some bugs.