Fix width calculation