Bugfixes/improvements to scheduler : PR #507