Updated code to work with Go v1.1