Made getBinairName more robust