DB connect & fixes