some rendering fixes and geometry optimizations