fixes broken direct middleware support. adds test
1.3.0