Fix issue where calling render multiple times within a single Rails action would cause a nil dereference.