Fix a couple things and clean up a bit