Fixes for issue #127