Fixed application middleware stack errors