bug fixes and improvements to support simulations