Added flexible command character. Bug fixes and clean-up.