Fixed bug with setupConnection handling errors properly