Fixed an issue where wrong bits was collected from hash in sign and wrote test to enlight problem in append.