Explicitly require 'desired' in unmarshalling the state, and add an explicit test that if desired is None, defaults to 0 (thanks @manishtomar)