some simulation bug fixes