Reformat and update tests