Fixed problems with SQL-connections.