Corrects NullPointerException for getTarget()