Bug fix: wrong encoding of double (needs testing).