diff --git a/datokenizer.go b/datokenizer.go
index af1e70f..7aea95a 100644
--- a/datokenizer.go
+++ b/datokenizer.go
@@ -1170,6 +1170,7 @@
 	eof := false
 	newchar := true
 
+PARSECHAR:
 	for {
 
 		if newchar {
@@ -1266,7 +1267,7 @@
 			buffo++
 
 			// Transition does not produce a character
-			if dat.isNonToken(t) && buffo == 1 {
+			if buffo == 1 && dat.isNonToken(t) {
 				if DEBUG {
 					fmt.Println("Nontoken forward", showBuffer(buffer, buffo, buffi))
 				}
@@ -1274,19 +1275,22 @@
 			}
 		}
 
-		// Transition marks the end of a token
+		// Transition marks the end of a token - so flush the buffer
 		if dat.isTokenEnd(t) {
 
-			data := []byte(string(buffer[:buffo]))
-			if DEBUG {
-				fmt.Println("-> Flush buffer:", string(data), showBuffer(buffer, buffo, buffi))
+			if buffi > 0 {
+				data := []byte(string(buffer[:buffo]))
+				if DEBUG {
+					fmt.Println("-> Flush buffer: [", string(data), "]", showBuffer(buffer, buffo, buffi))
+					fmt.Println("-> Newline")
+				}
+				writer.Write(data)
+				writer.WriteRune('\n')
+				rewindBuffer = true
 			}
-			writer.Write(data)
-			writer.WriteRune('\n')
-			rewindBuffer = true
 		}
 
-		// Rewind the buffer
+		// Rewind the buffer if necessary
 		if rewindBuffer {
 
 			// TODO: Better as a ring buffer
@@ -1311,9 +1315,14 @@
 			}
 		}
 
+		if eof {
+			break
+		}
+
+		newchar = true
+
 		// TODO:
 		//   Prevent endless epsilon loops!
-		newchar = true
 	}
 
 	// Input reader is not yet finished
@@ -1324,23 +1333,24 @@
 		return false
 	}
 
-FINALCHECK:
-
 	if DEBUG {
 		fmt.Println("Entering final check")
 	}
 
-	// Automaton is in a final state
+	// Automaton is in a final state, so flush the buffer and return
 	if dat.getCheck(dat.getBase(t)+uint32(dat.final)) == t {
 
 		if buffi > 0 {
 			data := []byte(string(buffer[:buffi]))
 			if DEBUG {
-				fmt.Println("-> Flush buffer:", string(data))
+				fmt.Println("-> Flush buffer: [", string(data), "]")
 			}
 			writer.Write(data)
 			if dat.isTokenEnd(t) {
 				writer.WriteRune('\n')
+				if DEBUG {
+					fmt.Println("-> Newline")
+				}
 			}
 		}
 
@@ -1348,45 +1358,24 @@
 		return true
 	}
 
-	// Try again with epsilon symbol, in case everything else failed
-	/*
+	// Check epsilon transitions until a final state is reached
+	t0 = t
+	t = dat.getBase(t0) + uint32(dat.epsilon)
+	if dat.getCheck(t) == t0 {
+		// Remember state for backtracking to last tokenend state
+		a = dat.epsilon
+		newchar = false
+		goto PARSECHAR
+	} else if epsilonState != 0 {
 		t0 = epsilonState
 		epsilonState = 0 // reset
 		buffo = epsilonOffset
 		a = dat.epsilon
-		goto CHECK
-	*/
-
-	// Check epsilon transitions until a final state is reached
-	t0 = t
-	t = dat.getBase(t0) + uint32(dat.epsilon)
-
-	// Epsilon transition failed
-	if t > dat.getCheck(1) || dat.getCheck(t) != t0 {
 		if DEBUG {
-			fmt.Println("Match is not fine!", t, "and", dat.getCheck(t), "vs", t0)
+			fmt.Println("Get from epsilon stack and set buffo!", showBuffer(buffer, buffo, buffi))
 		}
-		return false
+		newchar = false
+		goto PARSECHAR
 	}
-
-	if dat.isSeparate(t) {
-		// Move to representative state
-		t = dat.getBase(t)
-	}
-
-	if dat.isTokenEnd(t) {
-		if buffi > 0 {
-			data := []byte(string(buffer[:buffi]))
-			if DEBUG {
-				fmt.Println("-> Flush buffer:", string(data))
-			}
-			writer.Write(data)
-			buffi = 0
-			buffo = 0
-			epsilonState = 0
-		}
-		writer.WriteRune('\n')
-	}
-
-	goto FINALCHECK
+	return false
 }
