Small improvements

See commit comments for details.