Fixed some render code