Cleanups and trivial fixes