simulation tests and fixes