Various ufdt code fixes, added sys_stat stub