Fix build errors for 2.7