Fixing NULL tv_sec errors