Fixed a logic error in recent commit 938ee0f