missing db patches, null check, and a couple of tweaks