[expectations] Cleanup init and shutdown functions