Return one-based key so that user can check if the key is ever allocated
in the first place.

Initial patch submitted by: phk