Fixed some simulation issues