Fix text protocol output for too big flags

Flags is declared as unsigned 32 bits value however if higher bit is used then text protocol returns negative number.