Fixes the event and task store functions by checking for errors.