Fixed bug in xscript execution