Fixes a validation and exporting bug