scheduler: various fixes