undefined is not a valid value for the target property. Amends 5fe7ad2e (cherry picked from commit b4214478)