Ensuring all keys are tuples