Corrected functions to support non-numerical keys