Fix crashes with multimodule applications