Fixing bugs with first-bit encoding