Properly handling the new way namespaces are stored in the dataset info.
Fixed namespace declarations generation.