Fixes pickling issue