adds support for nested mappings and also fixes some issues with null values