Various fixes

Do: `max_name_width = max(len(c.name), max_name_width)`. Single line can replace the `if` statement. Do the same for below.