Fixes for issue #173