Fix broken tests; add test for format