toByte: few fixes