Adds simple pages check. Fix bug of merging arrays in wrong place