Will this solve the case where you have nested arrays with an empty array in the nested one? Perhaps this should recursively call deep_munge on each array element.