Fix for bad logic in commit 686cd1177c8147