Improvements to package management handling