Use access() instead of stat() for checking whether scripts exist.