- flatten nested lindex structures
- normalize string expressions
- improve robustness against invalid input