Some bug fixes and added a bunch of special cases for text comparison discrepancies