Implement #317, use primitive arrays, where appropriate, inside Array