Fix ambiguous db query in structure class.