fixes for 2.8.2 and 3.5.2