Fixed code violations and minor formatting issues