Some fixes around key-mapping.