Improved InvalidExitValueException error message.
Replaced some deprecated calls with new ones.