Correcting various code quality issues