Move the last literal yield up higher

Moved it above the standalone checking
Use endswith instead of splicing
Make the unknown tag message more apparent

Maybe this should throw an exception even