Setting last error JSON_ERROR_SYNTAX shouldn't be nessecary here, also overwrites existing more specific error messages

If it is nessecary perhaps we should check an error hasn't already been set so they're not overwritten