Use IntArray instead of Array<Integer>

Closes #2642