Fixed a logical bug.