Scripts/Misc: Fix uninitialized values

Fix uninitialized values in scripts reported by valgrind.
Fix target and GetOwner() NULL dereferences .