Cleanups and fixes (thanks @dtallen97)