Trying to make this compile with Go 1.2. WIP