Fixed DB connection error and match game bug

Explicitly closed all DB connections which were previously left open.
Managed exception behavior for match game.