Fix Error issues and other issues found with packaging

Same as https://github.com/bitpay/bitcore/pull/652 but without changing errors