Fixes incorrect key mappings and incorrect rest parsing