Define time_t as int
Fix some build issues