Fix typo and reformat code