Fixes for issue #155