Corrected Dictionary Handling logic for accepting keys of any type