Add test cases for callback on error
Fix cleanup function
Fix connect test
Remove references to missing dependancies