Fixed leftmost leave replacement.
Improved leftmost leaf replacement for nested choices.