fix various import-related bugs