Rendering now works fine. Removed profiling code.