Fix some bugs in the package.