Fixed some render bugs