Fix ArrayUtility and add tests