compile fixes for 3.x