merged latest from upstream

@dlecocq thanks!