Add more checks to avoid errors in exporter