Fixed a logical error.