fix for couchbeam sending last_seq messages
fix error responses
error responses handled incorrectly here too
fix for the twos complement code
merged.