Critical fix, msc_validate.py will fail to run without this.

Fixed conversion error of KeyError that prevented the code from running, and added try except block on json creation.