Prevent using invalid map sizes