Some cherrypicks, thanks dtrail. Sorry I messesd up on the commit