Refactored panel loading, and corrected minor lint-identified problems.