Better error checking

Check against != GNUTLS_E_SUCCESS instead of < 0.