Finally can sign correctly. Not cleaned up yet.
Cleaned up, now finding bug in the last test. Which should not be the last, i should write there more.