Fixed bug in detection of case name, added debug logging for connection methods.