Properly cache empty values

This makes nils invalid values for mutating and returns length-zero byte arrays as empty results for cache hits.