fix problems reported in issue #76