Created by: kortschak
This covers most of the errors found by goreport here.
@btracey @vladimir-ch @sbinet Please take a look.