Fix encoding of boolean values