Fixes a number of issues with database connection, discussed in team boa...

...rds

Signed-off-by: margarett <bruno.m.alves@gmail.com>