Fixed script parser to handle spaces and tabs better