Fixed array assignment bug