Several bugs fixes for import and data