Made sure that connections are always closed.