Fix rendering of layers with cl_show_entities and crashes