Reworked JSONError to be 5.5 compatible