Fix #12, #10, various other touch-ups