bunch of fixes for package rotation