DB bugfixes

Fixes bugs in the handling of asset creation and dynamic subtypes.