Bug fixes and new version for scheduler.

Change-Id: I9dbd6b0298a88e10511bb80cdc37495f501226bd