Also added trim to prevent a trailing space from breaking the dsn string for sqlite. Also added debug lines helpful for testing.