Fixed inconsistency with db api