fixed rendering problems, merged from 6.0.x, close #1934