Fixed a crash when creating small databases