Fixed alogorithm for converting untagged to tagged code blocks.