various fixes for demo database generation and related things

during creation of new demo databases I came across these bugs