Fixed a bug in the algorithm of picking up items.

See er/reminder.rb for details.