Integrate suggestions from issue #59