MODULES-1572 - Fix logic broken from MODULES-1309

Accidentally changed some behavior and broke things with the fix for
MODULES-1309
Merge pull request #441 from mhaskel/MODULES-1572

MODULES-1572 - Fix logic broken from MODULES-1309