Incorporating nits found by Alan Luchuk