Added safety check for simplejson backwards compatibility