ensure that package checks run smoothly; plus minor code cleanup