Added check for toggle_target to be undefined.