Refactoring: Code formatting and minor fixes.