Fix middleware `checkImports`