diff --git a/html5lib/inputstream.py b/html5lib/inputstream.py
index 5694efe3..ad5ca7dc 100644
--- a/html5lib/inputstream.py
+++ b/html5lib/inputstream.py
@@ -421,7 +421,7 @@ def __init__(self, source, encoding=None, parseMeta=True, chardet=True):
# Encoding Information
# Number of bytes to use when looking for a meta element with
# encoding information
- self.numBytesMeta = 512
+ self.numBytesMeta = 1024
# Number of bytes to use when using detecting encoding using chardet
self.numBytesChardet = 100
# Encoding to use if no other information can be found
@@ -430,6 +430,7 @@ def __init__(self, source, encoding=None, parseMeta=True, chardet=True):
# Detect encoding iff no explicit "transport level" encoding is supplied
if (self.charEncoding[0] is None):
self.charEncoding = self.detectEncoding(parseMeta, chardet)
+ assert self.charEncoding[0] is not None
# Call superclass
self.reset()