Incraese buffer size and add some SSL error checking (although not much)