Ensure we don't leak erlang terms on failure