improved perormance of ArrayImpl and fixed bug when passed array is empt...

...y

or smaller than min capacity