Implemented changes suggested in issue #364