Fix parser bug with implied close tags. Add some tests for incremental typing.