Fix formatting of plain numbers

The ios_flag_saver was placed in too wide a scope, so the std::hex
influenced the way attributes were formatted as well.