flatten was intentionally not used in the original code, because an Array is an accepted key in a Hash.  flatten would disable that.  Perhaps a spec is need for that case.  Let's not change the original implementation in this PR.  Let's keep it as close to the original as possible, unless it causes it to not work with Arrays.