Resubmitting #2030 for @averagesecurityguy

I added a little fix. Should be ready to land.