Improve typing of arrays containing untyped values