Fixed Doexec for FreeBSD