Added a license and fixed a DOM exception.