Fixes #1910. Fixes #1979. Fixes #1990. Fixes #1993. Fixes #2089. R=ken2 CC=golang-dev https://golang.org/cl/4828046