Fix compatibility with Go 1.2 and 1.3