[ExtractionScript]Bug Fix

Removed a bug related to faulty condition testing.
Removed a bug related to carrying over effect from loop.