Fix array subscript cast, only cast if there's actually something inside
the brackets.