Fix bug in external viewer code.