Fixed while loops to not break at newlines.