patched to handle serialization of undef required params.