issue #631 , missing some fixes