Fix check for executable to be platform independent.
Working again, only more modular now.