Fix command dispatch.
Handle database conection exceptions.