Respect 'as' option in key replacement