Attempt to fix some rendering bugs