Fix build error and reformat