Adjusted to work for Go 1.3

Functions replaced with newer versions