bug fixes for markdown processing