Better cleanup job scheduling. Some code inspection fixes