Fix ClassCastException if the values are stored as String instead of
numeric values