Fix accesses to the DOM which was missed in the commit @1303d68e3eecc1bff23c0fc82484fcb8fa1a2120