fix a bunch of tiny error and notices