Add new package_name parameter. Fixed some bugs.

Sorry if I did bad pull request. I'm new too github.