Fixed middleware: add `magicMode` option