Fixed problems and cleaned up batch-sheduler.c.