Fixed resetting stats after writePage bug, unit testing of readFooter