Fix checkstyle errors

Fixed many issues reported by CheckStyle.