FIX 0 is not false

Also unify preprocessing of write fields