Fix a minor bug and clean useless things