Improved error handling.
Much improved addpkg command.