Raised envelope storage limit and check for null pointer

Fixes issue 37