Fixed error in handling commands.