fixes for 3.13 and 3.12