Add more support for CPU count detection