Fix crashes in multiple commands