a few small fixes, and some cleanups.

But haven't really solved #38