Minor cleanups and improvements