Fix problem when reloading document that doesn't refresh, fixes ticket #16