Added url target checking, cleanup