Fixed a bug in organize_stimuli