Fix a cast in ppe and typos elsewhere