Cast objects to their correct types
Fix stubs in complex_rdf_datastream_spec