fixed some bugs in develop branch.