Bug 3: Handle bad syntax

Now a tag can end with either a '>' or by starting a new tag '<'.