Fixed a logic problem in the previous commit