Fix run-program in the same manner as it was fixed for FreeBSD