fix bugs in simulator
update proto_length_separated to new version