Fixed bugs with file i/o and renderer.