Fixes for issue #41 and #42.