Packaging cleanup and bug fixes