Package script causes exception when it fails