fixed some bugs; fixed cli