Fixed a small bug in DOM observing code