Fix key mappings to work better with autocomplete popup.