Minor cleanups and fixes