fixes for issue #39