Modified some violations, and cleant up the code.