Throw exception when something other than text or block tags are encountered inside of a parent tag. Other small cleanups