Fix targets is undefined in hasType - #618