Added test to verify rendering from files and fixed bugs.