Fixing erroneous DOM