Warning correction and useless code deletion