DB connection error fixes

https://catissueplus.atlassian.net/browse/PLUS-1014