Fix returned value when the previously store value was null.

A null value is returned as the string 'null'. Should return null instead
Bonus: code cleanup.