Fixed getSmartEvents cloud function