Improved data validation on import

Fixed sql request on testing in Category mode (structure data was lost)