Improved error description and failure reason when the JSON dictionary is nil

Sequel to #160