tw5 compatibility fixes