Prevent Infinite Loop

max_size may be unnecessary as a loop sentinel.