fixed a few errors in simulation unit