Change child process counting to such that it works in all supported platforms