Removes spurious middleware