Modified inclusion of <ctime> to <time.h>
Added a couple of Borland related workarounds