more bugfixes related to empty databases
Merge branch 'Dev' into Stable