Fix a strange context-related bug

The app would crash when loading anything the second time after generating documentation.