Merge in latest master contributions from @haxwell