fix BasePrimitive getSafeValue