Fixed some errors and tests on mdrender