Incorrect value being tested for being a Hash