Correct FD checking, duplicate init and dbg log