Integrate @bergey's fix for issue #2