Make resolution of binary path more robust