Modified set_flags()

Works but prints only 01, instead of 0100.