Fixed bug in array expansion