Fixes Dan's code review comments for Terry's fixes.