Fix package config path.
Add more tests and bug fix.