Command line working plus two other small bugs fixed