Modify some potential bug according to SonarQube.