mostly fixed bugs