Adding check include for ctime
Merging eith Gabriel's changes (ctime)