Fix tests by returning promises