Fix simulation script