Clean up update_simulation() and constraint checking.