Fix decoding of unknown type when using custom decoder