Testing Document.open() + other minor fixes.