Developing: fix some bugs