Various changes needed to improve the formatting API