Fix a bug with empty schedule case