add tests & fixes for complex commands