FIX 0 is not false

Also unify preprocessing of write fields
Merge pull request #12 from totaler/imp_prewrite_fields

FIX 0 is not false