Added middleware scanning to the autogen files