Fixed bug in doScript

Found a bug with checking for white space. Fixed.