Added asArray() method.