Fix bug in issue #378