mostly fixed errors