Fix errors 2, 3, 4, 6, 8, 9, 11, 12, 13, 14, and 15. (cherry picked from commit cb01268562)
cb01268562