gnutls merger with upstream. Fix old bugs which seemed to be the problem after all