3.1 compatibility fixes