Fix bug and some tiny modify.