Work around NPE in SetOnlyMarkersPrimitive, a proper fix does not seem to be possible with this architecture.