Fixing wrong way of parsing markdown tree.