fix type instability in getValue