fixes for issue #35 and issue #37