diff --git a/Evaluator.cpp b/Evaluator.cpp
index fd46805..696e555 100644
--- a/Evaluator.cpp
+++ b/Evaluator.cpp
@@ -56,6 +56,10 @@
 	{
 		return RuntimeResult(QList<Token>{Token(node.name())});
 	}
+	else if (node.isInteger())
+	{
+		return RuntimeResult(QList<Token>{Token::fromInteger(node.integer())});
+	}
 	else if (node.isVar())
 	{
 		if (!ctx.exists(node.name()) || ctx.exists(node.name()) != node.symbol())
diff --git a/Parser.cpp b/Parser.cpp
index c3d8330..145972f 100644
--- a/Parser.cpp
+++ b/Parser.cpp
@@ -78,7 +78,7 @@
         while (peek().isDigit())
             buffer += get();
 
-        *node = T(buffer, 10);
+        *node = T::fromInteger(buffer.toInt());
         return true;
     }
 
diff --git a/Token.cpp b/Token.cpp
index 20e2a16..53ba43a 100644
--- a/Token.cpp
+++ b/Token.cpp
@@ -1,6 +1,8 @@
 #include "Token.h"
 #include "AstNode.h"
 
+#include <QDebug>
+
 template class TokenBase<Token>;
 
 // This is kind of ugly and breaks separation of concerns; but if I don't do
@@ -45,6 +47,17 @@
 }
 
 template <typename T>
+T TokenBase<T>::fromInteger(int integer)
+{
+	T tok;
+
+	tok._type = INTEGER;
+	tok._intVal = integer;
+
+	return tok;
+}
+
+template <typename T>
 TokenBase<T>::TokenBase(char varType, const QString name)
 {
     _type = VAR;
@@ -89,7 +102,15 @@
 template <typename T>
 bool TokenBase<T>::operator==(const T &other) const
 {
-    return _type == other._type && _stringVal == other._stringVal && _charVal == other._charVal && _listVal == other._listVal;
+	// Why is this needed? Beats me.
+	if (isInteger() && other.isInteger())
+		return _intVal == other._intVal;
+
+    return _type == other._type &&
+		_stringVal == other._stringVal &&
+		_charVal == other._charVal &&
+		_listVal == other._listVal &&
+		_intVal == other._intVal;
 }
 
 template <typename T>
diff --git a/Token.h b/Token.h
index 6e0450c..41d8031 100644
--- a/Token.h
+++ b/Token.h
@@ -16,6 +16,8 @@
     explicit TokenBase(QList<T> parenthesized);
     TokenBase(char varType, const QString name);
 
+	static T fromInteger(int integer);
+
     bool operator==(const T &other) const;
     bool operator!=(const T &other) const;
 
diff --git a/main.cpp b/main.cpp
index 9a276f0..12f6dea 100644
--- a/main.cpp
+++ b/main.cpp
@@ -13,6 +13,7 @@
 
 int g_numFailed = 0;
 
+
 void testEval(QString function, QString expression, QString expected)
 {
 	Evaluator eval;
@@ -75,6 +76,11 @@
 	qDebug() << "\033[36mEvaluate\033[0m" << function << expression << "->" << result;
 }
 
+void testEval(QString function, QString expression, QList<Token> expected)
+{
+	testEval(function, expression, pprint(expected));
+}
+
 void testMatch(const QString &test, bool shouldBe, const MatchResult &result)
 {
     if (result.success != shouldBe)
@@ -210,7 +216,7 @@
     testParseAst("Hello; Goodbye");
     testParseAst("Key = Value");
 	testParseAst("123", {AstNode("123", 10)});
-	testParseAst("12 00", {AstNode("12", 10), AstNode("0", 10)});
+	testParseAst("12 00", {AstNode::fromInteger(12), AstNode::fromInteger(0)});
 }
 
 void testAllFunctionDefs()
@@ -222,6 +228,7 @@
 void testAllEvals()
 {
 	testEval("First {s.A e.Rest = s.A;}", "<First hello>", "h");
+	testEval("Number { = 123; }", "<Number>", QList<Token>{Token::fromInteger(123)});
 }
 
 int main(int argc, char *argv[])
@@ -235,7 +242,7 @@
 	cli.addHelpOption();
 	cli.addVersionOption();
 
-	QCommandLineOption testOption(QStringList{"t", "test"}, "Run test suite");
+	QCommandLineOption testOption(QStringList{"t", "test"}, "Run test suite.");
 	cli.addOption(testOption);
 
 	cli.process(a);
