Bugfix: ${#max_len} != $max_len