Handle the case where the encoder produces a null value (as it would for Some(null)) - possible fix to #99