Fixes following the CR by Chris and Duncan: