Update formatting and fix some warnings