Fix a bug and remove useless code.