Upstream master

fixed merged conflicts from Spencer's push.