Fix script element
The collect field of the script element was meant to be optional, but it was actually required. Also variables weren't being expanded there.
I also turned a BUG backtrace when a non existant directory is specified for collect into a FAILURE error.