Fixed javascript issues in simulations.js