Fix some rendering bugs