Fixed possible overflow condition.
Added model-'simulator'.