fixes for issue #686