Escape $ and . in keys, recursively