A more complete fix for 2 bugs (with 2 distinct instances of 1 bug) detected by Seth