Changed position of errorlog in connection check. Fixes #592