A more reliable way of dealing with hashes with mixed empty(auto)/preset keys