Fix some bugs in exported APIs.