Prevent valid log check from reading too much

Also, fix a JSON parsing bug