fix signature length and also safe binary_to_term