Fix detecting of errors in export