add --clang option and fix some bugs