Added OSX specific path_of_executable based on Pavel Morozkin's patch.