Fix some mistakes in rendering