Fixed some bugs, but other bugs crawled in.

going to fix them tomorrow.