fixed exception on empty line; generalised commands