Reformated code and fixed code inspection warnings.