Fix segfault if no modules loaded.