fix crash on incomplete tag
add test for incomplete tags
Merge pull request #1 from Yuras/master

Crash on incomplete tag