More readable Ada style.  Removed a race-condition.