Surprising behavior when modifying line in htc file

I was trying to change the number of bodies using either:

htc['new_htc_structure']['main_body']['nbodies'] = 3
htc['new_htc_structure']['main_body']['nbodies'] = [3]
htc['new_htc_structure']['main_body']['nbodies'] = '3'

But in all cases, wetb decides to add a new line instead of modifying the existing one. This is because of this code. The workaround that I've found is

from wetb.hawc2.htc_contents import HTCLine
htc['new_htc_structure']['main_body']['nbodies'] = HTCLine('nbodies', [3], "")

Also the following code creates a new line

htc['simulation']['time_stop'] = 10.0

while

htc['simulation']['time_stop'] = '10.0'

doesn't.

Is this expected behavior? Either way, I think that it should be documented.