fix some bugs. fix #4.