Various bits of cleanup.