Configured for postgres.
Fixed unclosed loop.