Fix: Undefined variable

Fixes #240.
Did you test this locally, by my reckoning this is already a StdClass before the json_decode.