Fix for the first problem in #17
Remove NULL fields before patching (#17)

Note that this also requires to remove fields that are not null, but
have a length of 0. Anyway, I was able to patch using this method.