Fix examples so they compile by removing deprecated calls