Added an upgrade step to remove duplicate stamps, added a unique index on (contextid, stamp) and modified the question_category edit code such that stamp duplication in the same context is not permitted.