made a few things compatible with 3.x