txtool: signing code bug fixes, readability improvements