I preserved what seemed to be the intent of #3983, but @ossinkine please look this over to make sure it's correct.