Write priority even if it is zero

Existence of int values should be tested comparing with `None` otherwise we miss `0` values