Fixed a crash when there was no target for the object