Prevent Infinite Loop

max_size may be unnecessary as a loop sentinel.
Remove all max_size vars