Also including changes from master's ca5740cf4d7ecc25a92bc845abb468a28f000af3