Implements #1233. Few sync improvement in scheduler tasks.