Fixed an error when target unit is enabled.