Fixed rendering bugs