Adaptations to merge with haskoin repository