Fixes for issue #178