Fixed bugs introduced by adding Format