Varioua code cleanups.