Added an array handling to the extend utility.