Fixing some deprecated middleware calls.