Bug fix for nested commands