Tweak logic from 618bfbd commit.

Signed-off-by: crynobone <crynobone@gmail.com>