Fixed some rendering bugs