Minor code adjustments and reformat.