Retry canonical signature

I ran into a non-canonical signature, can't reproduce it anymore though but I guess having something to deal with it in the code doesn't hurt ...

I also noticed there was no test for signing ... so I added one.

I also added something to make travis-CI do more loops of testing to possibly detection errors such as non-canonical signatures.