Resolved duplicate package declaration error

Also simplified os lookup for packages.