Fix for writing bool