The conditional doesn't feel like it's checking the right thing, though I think it would work, technically.  @gkatsev Thoughts?