Handle timed out connections that still exist but are not connected.
Added DEFAULT keyword to generated sql