Fix a bug in the browser monitoring js injection when the head_pos is 0.