Fix bug with error handling and rendering on client-side.
Add tests for PageRenderer.