Added support for debug script mode.
Fixed issue with multiple matching search fields. Props to @marpa