Fixes an issue where empty values were treated as null values and vica versa
This patch was authored by @fabianfett and released by @0xTim.
Fix encoding and decoding optional values to and from the database due to a regression in #135. Resolves #143 (#144)