DB fixes, struct architecture changes