Improve behaviors when a malformed refjson string is given.