Use has_key?, not [], to test for hashiness.