Updated to make work with go 1.1+