* Added connection error handling
* Added some tests