Adding new test fixture to ensure we don't accidently the whole document. Also fixes some bugs along the way