merged latest master from David

@dw : thanks!