Fix unsafe operation (guarded only by assert).