Fixing merge issues.
Adding support for the distributed scheduler.