Fix an NPE when commands were dispatched dynamically