Deniz's bugfix for duplicated features.