Fixes #4129
Actually test the connection
Update file to meet coding standarts