Properly cast json to array.

See http://codepad.org/CJy32qQD
Merge pull request #3 from cmfcmf/patch-1

Properly cast json to array.