Refined support for markdown files.
Small changes and fixes