Fixed various IE quirks and broken unit tests.