More cleanups and fixes, still kind of broken...