Fix checking for array