misc simulation bug fixes