Improved Hash::toArray()