formatter tests and minor fixes