Merge #719, close #467

WIP, still need to look at the signature tests