knuth error update

I updated knuth's error handling as well as miscellaneous bugs along the way.