Enhance key adding by restricting the entry possibilities according to the type checked.
Add missing module importation.