Niels code cleanup.