Fix path search issue when main program and packages are installed into different locations.