Cleaning up some error handling in renderText