Real fix for Issue #7

The HTML with the replaced IDs was not making it to the output. Also, multiple duplicates still had issues. Should be resolved. Needs tests.