A kit already has its lowest flag on. The ready bit is worth 8. Combine it with the existing flags using OR rather than replacing the whole value. The printed number will let you check that both bits remain set.
ready bit in flags using | or |=, then print Flags: 9 followed by a newline. Do not replace the existing flags with a literal 9.OR preserves any bits that were already on: flags |= ready.