Fixed logical error.