Minor correction to render function