Fix to start and end time definitions

No longer -1 if not defined
removed some warnings