Fixed Ruby 1.9 issue with hash's to_h protocol.

I forgot that this return nil on Ruby 1.9.