Change the api and fixes according to golang-nuts review.