Add support for multiple datasets and fix missing fields for codes