Fix JTP logging in case of error