Added tests, fix to markdown parsing