Additional database and structural fixes