I started a patch for this bug but got stuck here, too. Nice catch!