Added unit test to make sure a valid closing tag with space at the end doesn't produce an error
Made unit test correct since error is set to null and is never undefined
Modified the error message to be simpler/more clear