Adding some fixes to the updateKeyMappings function

For some reason merging didn't pick this up