Cleaned up scheduler service and fixed major bug