Added handling of times of nil and test