Fixed saving/restoring state issues for exercise. Removed logging
statements and put them in the debug branch instead.