Include changes from @b4hand and @dlecocq.