General cleanup, mostly better debugging messages