Fixing issue in `toJSONObject` function of `Schedule` class.

The issue: TimeRanges is null. This might happen if Schedule was constructed with
```c#
public Schedule(int activationLimit) :
```
In which case `TimeRanges` will be null.
Merge branch 'master' into classname_for_all

* master:
  Fixing issue in `toJSONObject` function of `Schedule` class.