Fixed logic error in Target functionality