Fixing the application context errors