Fixed issue with array slice