Corrected some code in preparation to add logic to handle pre code blocks.