Updates based on issue #620 and updated tests