Add some error checking for missing start/end tags