various fixes for 2.7/3