Fix inconvertable type. Pre-J7 Integer, not int, must be used to cast Objects
Remove getPackage() call as it can return null