Clean up code formatting and fix warning