Patch definition bugs

- Definitions wouldn't escape <tags>... now they do
- Invalid def tags would throw weird errors... now throw correct errors,
and only when needed.