fix bd_dijkstra crash on MacOSX.
Merge pull request #139 from sanak/develop_issue136

fix bd_dijkstra crash on MacOSX.