Safety checks to avoid errors in log