Added database configuration and fixed tests