Remove unnecessary array cast