Work around crash in render code. Vlj, please review this, this is likely not the proper fix