fixed some errors floating around. don't know if most of them were in dead functions or not.