Fixed some rendering code