Fix command registration bug